﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SchoolLibrary.Entity.Person;

namespace SchoolLibrary.Desktop.Guide.Input
{
    public class ClassLeaderInputDialog : PersonInputDialog
    {
        private ClassLeader classLeader;

        public ClassLeaderInputDialog() : base() { } 

        public ClassLeaderInputDialog (ClassLeader classLeader) : this()
        {
            this.classLeader = classLeader;
            setPerson(classLeader);
        }

        protected override void okButton_Click(object sender, EventArgs e)
        {
            if (classLeader == null)
            {
                classLeader = new ClassLeader();
            }
            build(classLeader);
            this.Close();
        }

        public ClassLeader ClassLeader
        {
            get { return classLeader; }            
        }

        private void InitializeComponent()
        {
            this.SuspendLayout();
            // 
            // ClassLeaderInputDialog
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.ClientSize = new System.Drawing.Size(264, 233);
            this.Name = "ClassLeaderInputDialog";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

    }
}
